package com.sailing.xjpb.common.exception;


import com.sailing.xjpb.common.web.ResponseCode;
import lombok.*;

/**
 * 异常父类
 *
 * @author YW
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@EqualsAndHashCode(callSuper = false)
public class SailingException extends RuntimeException {
	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	private int responseCode;

	public SailingException(int responseCode, String msg) {
		super(msg);
		this.responseCode = responseCode;
	}

	public SailingException(int responseCode, String msg, Throwable t) {
		super(msg, t);
		this.responseCode = responseCode;
	}

	public SailingException(ResponseCode responseStatus, String msg) {
		this(responseStatus.getCode(), msg);
	}

	public SailingException(ResponseCode responseStatus, String msg, Throwable t) {
		this(responseStatus.getCode(), msg, t);
	}

	public int getResponseCode() {
		return responseCode;
	}

	public void setResponseCode(int responseCode) {
		this.responseCode = responseCode;
	}

}
